<div class="row-fluid">
    <div class="span2">
        <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                //'buttonType' => 'ajaxLink',
                'type' => 'primary',
                'label' => t('Create & Clear'),
                'url' => $this->createURL('customerloansetting/create', array(
                    'id4clear' => $customerloansetting->id,
                    'owedloan' => $customerloansetting->owedloanSum,
                )),
            ));
        ?>
    </div>
    <div class="span2">
        <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                'buttonType' => 'Button',
                'type' => 'primary',
                'label' => t('Back'),
                //'htmlOptions' => array('onclick' => 'window.history.go(-1)'),
                'url' => $this->createURL('customerloansetting/index'),
                'icon' => 'icon-white icon-arrow-left',
            ));
        ?>
    </div>
</div>
<?php
    $dataProvider = new CActiveDataProvider('CustomerLoanPayment', array('data' => $customerloanpayments));
    $this->widget('bootstrap.widgets.TbGridView', array(
        'type' => 'striped bordered condensed',
        'dataProvider' => $dataProvider,
        'template' => '{items}',
        'columns' => array(
            array('name' => 'installment_no', 'header' => t('Installment No.')),
            array('name' => 'pay_on_date', 'header' => t('On Date')),
            array('name' => 'payment', 'header' => t('Payment')),
            array('name' => 'paid_amount', 'header' => t('Paid Amount')),
            array('name' => 'paid_on_date', 'header' => t('Paid on Date')/* , 'value' => 'isset($data->paid_on_date)?date("Y-m-d", strtotime($data->paid_on_date)):""' */),
            array('name' => 'remark', 'header' => t('Remark')),
            array(
                'class' => 'bootstrap.widgets.TbButtonColumn',
                //'htmlOptions' => array('style' => 'width: 50px'),
                'template' => '{update}',
                'buttons' => array(
                    'update' => array(
                        'label' => t('Pay'),
                        'visible' => '(floatval($data->paid_amount) <= 0) && ($data->pay_on_date <= date(\'Y-m-d\'))',
                    ),
                ),
            ),
        ),
    ));
?>
